import React from 'react';
import { WeaFormItem, WeaSelect } from 'ecCom';
import { WeaLocaleProvider } from 'ecCom';

const getLabel = WeaLocaleProvider.getLabel;

// 链接方式
class ELinkMode extends React.Component {
    state = {
        value: this.props.value,
    };

    render() {
        return (
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@q15jtk`} label={getLabel(19494, '链接方式')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
                <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@q3h8jj`}
                  options={
                        this.props.options.map(item => ({ key: item.key, selected: false, showname: item.value }))
                    }
                  value={this.state.value}
                  detailtype={3}
                  onChange={(value) => {
                        this.setState({ value });
                    }}
                />
            </WeaFormItem>
        );
    }

    getSaveValues() {
        return this.state.value;
    }
}

export default ELinkMode;
